<?php
/* Generate The Teasers */
function wpboxes_custom_excerpt($string, $limit)
{
    $string = strip_shortcodes($string);
    $string = strip_tags($string);

    $string = preg_replace("/&#?[a-z0-9]{2,8};/i","",$string);
    $words = explode(' ', $string);
    if (count($words) >= $limit) {
	return implode(' ', array_slice($words, 0, $limit)) . " ...";
    } else {
	return implode(' ', array_slice($words, 0, $limit));
    }
}
?>